void reverse(vector<int> &a, int i, int j) {
	int temp;
	for (; i < j; i++, j--) {
		int temp = a[i];
		a[i] = a[j];
		a[j] = temp;
	}
}
void rotate(vector<int> &nums, int k) {
	k %= nums.size();
	reverse(nums, 0, nums.size() - 1);
	reverse(nums, 0, k - 1);
	reverse(nums, k, nums.size() - 1);
}